#include "smart-device-net-protocol.h"

using namespace std;

int main(int argc, char const *argv[])
{
	SmartDevicenetProtocol netProtocol;
	netProtocol.addOperation("doorlock");
	netProtocol.addCommand("add");
	netProtocol.addDevice("0x00", "0x00");
	string jsonData = netProtocol.toString();

	cout << "jsonData" << jsonData << endl;

	cout << "--------------------------" << endl;

	SmartDevicenetProtocol newProtocol = SmartDevicenetProtocol::fromJsonData(jsonData);
	cout << "operation	  : " << newProtocol.getOperation() << endl;
	cout << "command	  : " << newProtocol.getCommand() << endl;
	cout << "deviceType	  : " << newProtocol.getDeviceType() << endl;
	cout << "deivceNumber : " << newProtocol.getDeviceNumber() << endl;

	return 0;
}
